#ifndef CAMERA_H
#define CAMERA_H


#include <cmath>
#include <SDL/SDL.h>
#include <GL/glu.h>
#include <map>
#include <iostream>
#include <string>
#include "Vector3F.h"

class Camera
{
	public:

	Camera(const Vector3F & position = Vector3F(0,0,0));

	 void mvtSouris();
	 void moletteSouris(const SDL_MouseButtonEvent & event);
	 void clavier(Uint8 *keystate);

	 void animer(Uint32 tps);
	 void setVitesse(float vitesse);
	 void setSensibilite(float sensib);

	 void setPosition(const Vector3F & position);

	 void look();

	Vector3F getCible();

	 ~Camera();

	
	private:
	
	float _vitesse;
    float _sensib;

	int _posX, _posY;
	int _relX, _relY;

    Uint32 _tpsMax;
    bool _mvtVertA;
    int _mvtVertDir;

    typedef std::map<SDLKey,bool> KeyStates;
    KeyStates _action;
    typedef std::map<std::string,SDLKey> Keyconf;
    Keyconf _event;


    Vector3F _avant;
    Vector3F _gauche;
    float _theta;
    float _phi;

    void vectorsFromAngles();
    
    Vector3F _position;
    Vector3F _cible;

};

#endif
